<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head>
  <meta name="copyright" content=
  "Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="Content-Style-Type" content="text/css">
  <script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js" type="text/javascript"></script>
  <link rel="STYLESHEET" href="../book.css" type="text/css">
  <title>Content Types</title>
</head>
<body bgcolor="#FFFFFF">
  <h1 class="Head">Content Types</h1>
  <p class="Para">The <a class="command-link" href=
  'javascript:executeCommand("org.eclipse.ui.window.preferences(preferencePageId=org.eclipse.ui.preferencePages.ContentTypes)")'>
  <img src="PLUGINS_ROOT/org.eclipse.help/command_link.svg" alt="command link"><strong>General &gt; Content
  Types</strong></a> preference page enables you to edit content types and their associated file names, editors and
  character sets. You can also associate arbitrary file names or file extensions with content types. A <i>content
  type</i> acts as a description of a certain class of files (for instance, XML files). Eclipse uses this description
  in various scenarios, such as editor look-ups and file comparisons.</p>
  <h2>Manage content type definitions</h2>
  <p class="Para">You can define new content types from this preference page. On the right of the tree showing all
  content types, click on <b>Add Root...</b> or <b>Add Child...</b> (in case a content type is already selected) to
  define a new content type. You'll then be asked for the name.</p>
  <p>Content types that were created manually from the preference page are stored in the user data area.</p>
  <p>Content types that were created manually can be removed thanks to the <b>Remove</b> button. Removing a content
  type definition also removes all children content type definitions. Content type that were defined by plug-ins cannot
  be removed.</p>
  <h2>Associating content types with file name or extension</h2>
  <p class="Para">By selecting a content type in the topmost tree, you can alter the file names and extensions that are
  associated with it.</p>
  <p class="note"><strong>Note:</strong> Certain name specification will show a "lock" icon. An item is locked if it is
  one of the associations provided by the plug-in that declares the content type. In other words, you can remove only
  user-contributed associations.</p>
  <p class="Para">Adding an association is as simple as clicking <strong>Add...</strong>. A dialog prompts you to enter
  the file name or extension.</p>
  <h2>Associating editors with content types</h2>
  <p class="Para">The second list below the content types tree shows the editors that are directly declared as suitable
  to open the given content type. Editors associated with parent content types are also valid editors for the children
  content type, although they are not shown there.</p>
  <p>For any content type, you can declare a new editor association using the <b>Add...</b> button besides the list of
  editors. This button will let you pick a new editor to associate with the selected content type.</p>
  <p>Those user-defined editor associations are stored in the user data area.</p>
  <p>Editor associations defined manually can be removed thanks to the <b>Remove</b> button. Editor associations that
  were defined by a plug-in are locked and cannot be removed.</p>
  <p>In case there are multiple editors suitable to open a content type, you can declare one of these editors as
  default editor (the preferred editor). Just select the editor in the associated editors list and press the
  <b>Default</b> button. If there is no default editor, the first suitable editor found is used to open the
  content type.</p>
  <h2>Define default encoding for content type</h2>
  <p class="Para">You can also set the default encoding for a given content type. To do this, simply enter the encoding
  name in the provided field and click <strong>Update</strong>.</p>
</body>
</html>
